﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Xml;
using WPFClient.FluxService;

namespace WPFClient
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            FluxServiceClient fsc = new FluxServiceClient();
            Flux[] temp = fsc.GetAllFlux();

            for (int it = 0; it < temp.Count(); it++)
            {

                using (XmlReader reader = XmlReader.Create(temp[it].Source))
                {
                    SyndicationFeed feed = SyndicationFeed.Load(reader);
                    lstFeedItems.ItemsSource = feed.Items;
                }
            }


        }
    }
}
